package com.qh.resourcehub.info.user.controller;

import com.qh.resourcehub.info.entity.ApplicationData;
import com.qh.resourcehub.info.user.dto.UserDataDto;
import com.qh.resourcehub.info.user.service.UserDataInfoService;
import com.qh.resourcehub.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/*
 * @Description: 用户相关信息
 * @param null
 * @return
 * @Author: Y6
 * @Date: 2024/12/4 13:54
 */
@RestController
@RequestMapping("/UserDataInfo")
public class UserDataInfoController {
    @Autowired
    private UserDataInfoService userDataInfoService;
    /*
     * @Description: 查询审批用户
     * @param userDataDto
     * @return
     * @Author: Y6
     * @Date: 2024/12/4 18:58
     */
    @GetMapping("/queryApplicationUserData")
    public ApiResponse queryApplicationUserData(@RequestBody UserDataDto userDataDto) {
        try {
            List<Map<String,Object>> i = userDataInfoService.queryApplicationUserData(userDataDto);
            if (i.size()>0){
                return ApiResponse.succeed(i);
            }else {
                return ApiResponse.succeedNoData();
            }
        }catch (Exception e){
            return ApiResponse.succeedRequestNo();
        }
    }
}
